<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:oso="http://osoftware.com/facelets" template="/WEB-INF/templates/mainSearchLayout.xhtml">

	<ui:define name="title">
		<h:outputText value="#{resourceBundle['bill.title']}" />
	</ui:define>

	<ui:define name="searchFields">
		<oso:selectOneMenu id="patientFilter" label="#{resourceBundle['bill.patient']}" value="#{billModel.filter.patient}" converter="patientConverter" items="#{billModel.selectablePatients}"
			itemLabel="fullName" />
	</ui:define>

	<ui:define name="listValues">
		<ui:param name="listModel" value="#{billModel.list}" />
		<ui:param name="targetObject" value="#{billModel.editedEntity}" />
		<ui:param name="modifiable" value="false" />
	</ui:define>

	<ui:define name="searchColumns">
		<p:column sortBy="#{row.billId.id}" style="width:50px;">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['bill.id']}" />
			</f:facet>
			<h:outputText id="id" value="#{row.billId}" >
			</h:outputText>
		</p:column>
		<p:column sortBy="#{row.date}" style="width:150px;">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['bill.date']}" />
			</f:facet>
			<h:outputText id="date" value="#{row.date}">
				<f:convertDateTime pattern="dd/MM/yyyy HH:mm" />
			</h:outputText>
		</p:column>
		<p:column sortBy="#{row.patient.fullName}">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['bill.patient']}" />
			</f:facet>
			<h:outputText value="#{row.patient.fullName}" />
		</p:column>
		<p:column sortBy="#{row.amount}" style="width:50px;" styleClass="amount">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['bill.amount']}" />
			</f:facet>
			<h:outputText value="#{row.amount}">
				<f:convertNumber pattern="0.00"/>
			</h:outputText>
		</p:column>
	</ui:define>

	<ui:define name="actionColumns">
		<h:commandLink action="printPDF" title="#{resourceBundle['list.header.print']}" styleClass="ui-icon ui-icon-print actionColumnElement">
			<f:setPropertyActionListener target="#{targetObject}" value="#{row}" />
		</h:commandLink>
	</ui:define>
</ui:composition>